/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ar.com.neolokura.travian.helper.account.admin;

import ar.com.neolokura.travian.helper.account.entity.Village;
import ar.com.neolokura.travian.helper.account.entity.Village;
import ar.com.neolokura.travian.helper.browser.admin.BrowserAdmin;
import ar.com.neolokura.travian.helper.constant.ResourceConstants;
import ar.com.neolokura.travian.helper.constant.TravianWebTree;
import com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException;
import com.gargoylesoftware.htmlunit.WebClient;
import com.gargoylesoftware.htmlunit.html.HtmlPage;
import java.io.IOException;

/**
 *
 * @author gustavo
 */
public class AccountHelper {

    private WebClient webClient;

    public AccountHelper() {
        BrowserAdmin browserAdmin = BrowserAdmin.getInstance();
        webClient = browserAdmin.getWebClientInstance();
    }

    public Village getVillageByPage(HtmlPage page) throws FailingHttpStatusCodeException, IOException {
        //TODO: Get Full Village From Here!

        TravianWebTree tree = new TravianWebTree();
        ResourceConstants travianBuildings = new ResourceConstants();

        page = webClient.getPage(tree.getBuildingLink() + travianBuildings.getRallyPointId());
        Village village = new Village();



        return village;
    }
}
